module.exports = {
  /*
  ** Headers of the page
  */
  head: {
    title: "阳光沙滩老船长",
    meta: [
      {charset: 'utf-8'},
      {name: 'viewport', content: 'width=device-width, initial-scale=1'},
      {hid: 'description', name: 'description', content: '{{我的有一个特殊的练习，谢谢拉大锯老师。买到就是赚到。不买省百分百}}'},
      {hid: 'keywords', name: 'keywords', content: "淘宝，优惠，领劵"}
    ],
    link: [
      {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
    ]
  },

  css: [
    'element-ui/lib/theme-chalk/index.css'    // 1.在 css 中配置 element-ui 的 css 位置
  ],
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    {
      src: '@/plugins/test',
      ssr: true
    },    // 2.在 plugins 中配置刚刚创建好的 plugin
  ],

  modules: [
    // Simple usage
    '@nuxtjs/proxy',
  ],

  axios: {
    proxy: true,
    prefix: '/union/',
    credentials: true
  },

  proxy: {
    '/union/': {
      target: 'https://api.sunofbeach.net/shop/api/',
      pathRewrite: {
        changeOrigin: true,
        '^/union/': ''
      }
    }
  },

  /*
  ** Customize the progress bar color
  */
  loading: {color: '#66ccff'},
  /*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLint on save
    */
    extend(config, {isDev, isClient}) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
};
